<?php
$completionHandler = "

    if (msg == 'OK') {
        console.log(msg);
        document.getElementById('upload_results').innerHTML = '<h1>OK! ...redirecting in 3 seconds</h1>';

        // reset camera for another shot
        webcam.reset();
        //setTimeout(function(){window.location = 'index.php?r=user/index';},3000);
    }
    else alert('PHP Error: ' + msg);
    ";

$this->widget('application.extensions.jpegcam.EJpegcam', array(
        'apiUrl' => Yii::app()->createUrl('PenerimaanTamu/jpegcam.saveJpg'),
        'shutterSound' => true,
        'jpegQuality' => 100,
        'camWidth' => '240',
        'camHeight' => '160',
        'serverWidth' => '320',
        'serverHeight' => '240',
        'stealth' => true,
        'buttons' => array(
            //'configure' => 'Configure',
            //'takesnapshot' => 'Take Snapshot!',
            'freeze' => 'Capture',
            'upload' => 'Upload',
            'reset' => 'Reset'
        ),
        'onBeforeSnap' => '',
        'completionHandler' => $completionHandler
    )); 
?>
